#ifndef SANGAME_BASE_BASE_H_
#define SANGAME_BASE_BASE_H_

namespace sangame {
namespace base {

typedef signed char         schar;
typedef signed char         int8;
typedef short               int16;
typedef int                 int32;
typedef long long           int64;

typedef unsigned char		uint8;
typedef unsigned short		uint16;
typedef unsigned int		uint32;
typedef unsigned long long	uint64;

struct Void;

typedef void* Handle;

struct Rect {
    int left;
    int top;
    int right;
    int bottom;
};

struct Point {
    int x;
    int y;
};

template<typename T>
struct Range {
    T lower_bound;
    T upper_bound;
};

template<int v>
struct Int2Type {
    enum { value = v };
};

template <class Dest, class Source>
inline Dest bit_cast(const Source& source)
{
    Dest dest;
    memcpy(&dest, &source, sizeof(dest));
    return dest;
}

template<class Dest, class Source>
Dest lexical_cast(Source const &source)
{
    return boost::lexical_cast<Dest>(source);
}

} // namespace base
} // namespace sangame

#endif // SANGAME_BASE_BASE_H_